C This is FORTRAN source code which will compile into
C an xCOD (eXternal CODe) resource for NumberCrunch II.
C
C
C After building this code resource you must install it into NumberCrunch with either ResEdit or the
C Load xCOD command from inside NCII.
C
C In either case, an sCOD string or resource is also needed to tell NCII what the arguments to this routine are
C For this routine, an appropriate sCOD is:
C
C xCOD xSAMPLE_XCODE(J:num; Bj:Array; prog Foo(K:num; Ak:array); Cj:ComplexArray), sets all of Cj[1…J] to 1 + 0i, Bj[1…j] to 1…j, and passes a K=3 element array [3,2,1] to Foo.
C
C The procedure arguments are}
C J : extended number}
C Bj : array of extended}
C foo : the name of another xCOD or an NCII user program
C Cj : an array of complex numbers, i.e. a 2J array of extended
C
C
subroutine SAMPLE_XCOD(zJ, Bj, Foo, Cj)
implicit extended (a-h, o-z)
dimension Bj(*), Cj(*), ArrayForFoo(3)
external Foo
C
C Convert the array size to an integer.
J = zJ
C
C Set the Bj array.
do i=1,J
Bj(i) = 1.0*i
end do
C
C Set the (real, complex, real, complex, ...) array Cj to 1 + 0i.